package edu.pku.sei.transformation.editor.controller.commands.link;

import edu.pku.sei.transformation.editor.model.Rule;
import edu.pku.sei.transformation.editor.model.RuleOverride;

public class OverrideCreateCommand extends
		AbstractLinkCreateCommand<RuleOverride, Rule, Rule> {
	public OverrideCreateCommand(RuleOverride link, Rule source) {
		super(link, source);
	}
	@Override
	public void execute() {
		source.setOverride(link);
		link.setOverrideRule(target);
		link.setOverriedBy(source);
	}
	@Override
	public void undo() {
		source.setOverride(null);
		link.setOverrideRule(null);
		link.setOverriedBy(null);
	}
}
